package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.IntegralSettingMapper;
import com.ruoyi.business.domain.IntegralSetting;
import com.ruoyi.business.service.IIntegralSettingService;

/**
 * 积分设置Service业务层处理
 * 
 * @author lcz
 * @date 2025-01-24
 */
@Service
public class IntegralSettingServiceImpl implements IIntegralSettingService 
{
    @Autowired
    private IntegralSettingMapper integralSettingMapper;

    /**
     * 查询积分设置
     * 
     * @param id 积分设置主键
     * @return 积分设置
     */
    @Override
    public IntegralSetting selectIntegralSettingById(Long id)
    {
        return integralSettingMapper.selectIntegralSettingById(id);
    }

    /**
     * 查询积分设置列表
     * 
     * @param integralSetting 积分设置
     * @return 积分设置
     */
    @Override
    public List<IntegralSetting> selectIntegralSettingList(IntegralSetting integralSetting)
    {
        return integralSettingMapper.selectIntegralSettingList(integralSetting);
    }

    /**
     * 新增积分设置
     * 
     * @param integralSetting 积分设置
     * @return 结果
     */
    @Override
    public int insertIntegralSetting(IntegralSetting integralSetting)
    {
        integralSetting.setCreateTime(DateUtils.getNowDate());
        return integralSettingMapper.insertIntegralSetting(integralSetting);
    }

    /**
     * 修改积分设置
     * 
     * @param integralSetting 积分设置
     * @return 结果
     */
    @Override
    public int updateIntegralSetting(IntegralSetting integralSetting)
    {
        integralSetting.setUpdateTime(DateUtils.getNowDate());
        return integralSettingMapper.updateIntegralSetting(integralSetting);
    }

    /**
     * 批量删除积分设置
     * 
     * @param ids 需要删除的积分设置主键
     * @return 结果
     */
    @Override
    public int deleteIntegralSettingByIds(Long[] ids)
    {
        return integralSettingMapper.deleteIntegralSettingByIds(ids);
    }

    /**
     * 删除积分设置信息
     * 
     * @param id 积分设置主键
     * @return 结果
     */
    @Override
    public int deleteIntegralSettingById(Long id)
    {
        return integralSettingMapper.deleteIntegralSettingById(id);
    }
}
